'  Function: mAdder
  'By:~Wyldechylde~
'Credit due: Karcrack! (addmodule function) Br1337: (random string functions)
'  Usage: (with junk) Call Addmodule(projectpath,modulefunction)
'  Usage: (no junk) Call Addmodule(Vb6ProjectPath)
'
'This is one simple mod I made from snippet Karcrack wrote & distributed in their
'Kpc 2.1 program. It just adds junk modules/class modules to a vb6 project file
'kinda usefull for bypassing some fprot detections & making a stub a lil more unique
'
'If you wish to add different junk other than plain goto's then change function of
'"modulefunction"
'
'IF you use this or distribute it in a app dont be a HF bitch, give me some credit (& above ppl credits)!
'

Public Sub AddModule(ByVal RutaPrj As String, Optional ByVal sData As String)
    Dim Info  As String
    Dim Al    As String
    Dim NuevoMod    As String
    Open RutaPrj For Binary As #1
    Info = Space(LOF(1))
    Get #1, , Info
    Close #1
    Al = strings
    Info = "Module=" & Al & "; " & Al & ".bas" & vbCrLf & Info
    'If Check2.Value = 1 Then FileCopy RutaPrj, RutaPrj & ".bk"
    Open RutaPrj For Binary As #1
    Put #1, , Info
    Close #1
    NuevoMod = Left$(RutaPrj, InStrRev(RutaPrj, "\")) & Al & ".bas"
    Open NuevoMod For Binary As #1
    Put #1, , sData
    Close #1
End Sub

Public Sub AddClass(ByVal RutaPrj As String, Optional ByVal sData As String)
    Dim Info  As String
    Dim Al    As String
    Dim NuevoMod    As String
    Open RutaPrj For Binary As #1
    Info = Space(LOF(1))
    Get #1, , Info
    Close #1
    Al = strings
    Info = "class=" & Al & "; " & Al & ".cls" & vbCrLf & Info
    'If Check2.Value = 1 Then FileCopy RutaPrj, RutaPrj & ".bk"
    Dim bla As String

    bla = bla & "VERSION 1.0 CLASS" & vbNewLine
bla = bla & "BEGIN" & vbNewLine
bla = bla & "  MultiUse = -1  'True" & vbNewLine
bla = bla & "  Persistable = 0  'NotPersistable" & vbNewLine
bla = bla & "  DataBindingBehavior = 0  'vbNone" & vbNewLine
bla = bla & "  DataSourceBehavior  = 0  'vbNone" & vbNewLine
bla = bla & "  MTSTransactionMode  = 0  'NotAnMTSObject" & vbNewLine
bla = bla & "END" & vbNewLine
bla = bla & "Attribute VB_Name = " & Chr(34) & randomletter & RandomNumber & strings & RandomNumber & RandomNumber & Chr(34) & vbNewLine
bla = bla & "Attribute VB_GlobalNameSpace = False" & vbNewLine
bla = bla & "Attribute VB_Creatable = True" & vbNewLine
bla = bla & "Attribute VB_PredeclaredId = False" & vbNewLine
bla = bla & "Attribute VB_Exposed = False" & vbNewLine
    Open RutaPrj For Binary As #1
    Put #1, , Info
    Close #1
    NuevoMod = Left$(RutaPrj, InStrRev(RutaPrj, "\")) & Al & ".cls"
    Open NuevoMod For Binary As #1
    Put #1, , bla & sData
    Close #1
End Sub

Function ModuleFunction()
For i = 1 To Random(3, 8) '3= min junk functions & 8 = max junk functions modify to what you want...
Dim fFunction As String
dur = Random(1, 3)
Select Case (dur)
Case 1
fFunction = fFunction & "Function " & randomletter & RandomNumber & strings & RandomNumber & RandomNumber & " ()" & vbNewLine
fFunction = fFunction & "Goto blah1" & vbNewLine & "blah1:" & vbNewLine
fFunction = fFunction & "Goto blah2" & vbNewLine & "blah2:" & vbNewLine
fFunction = fFunction & "Goto blah3" & vbNewLine & "blah3:" & vbNewLine
fFunction = fFunction & "Goto blah4" & vbNewLine & "blah4:" & vbNewLine
fFunction = fFunction & "Goto blah5" & vbNewLine & "blah5:" & vbNewLine
fFunction = fFunction & "Goto blah6" & vbNewLine & "blah6:" & vbNewLine
fFunction = fFunction & "Goto blah7" & vbNewLine & "blah7:" & vbNewLine
fFunction = fFunction & "Goto blah8" & vbNewLine & "blah8:" & vbNewLine
fFunction = fFunction & "Goto blah9" & vbNewLine & "blah9:" & vbNewLine
fFunction = fFunction & "Goto blah10" & vbNewLine & "blah10:" & vbNewLine
fFunction = fFunction & "End Function" & vbNewLine

fFunction = Replace(fFunction, "blah1", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah2", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah3", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah4", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah5", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah6", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah7", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah8", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah9", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah10", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)

Case 2
fFunction = fFunction & "Sub " & randomletter & RandomNumber & strings & RandomNumber & RandomNumber & " ()" & vbNewLine
fFunction = fFunction & "Goto blah1" & vbNewLine & "blah1:" & vbNewLine
fFunction = fFunction & "Goto blah2" & vbNewLine & "blah2:" & vbNewLine
fFunction = fFunction & "Goto blah3" & vbNewLine & "blah3:" & vbNewLine
fFunction = fFunction & "Goto blah4" & vbNewLine & "blah4:" & vbNewLine
fFunction = fFunction & "Goto blah5" & vbNewLine & "blah5:" & vbNewLine
fFunction = fFunction & "Goto blah6" & vbNewLine & "blah6:" & vbNewLine
fFunction = fFunction & "Goto blah7" & vbNewLine & "blah7:" & vbNewLine
fFunction = fFunction & "Goto blah8" & vbNewLine & "blah8:" & vbNewLine
fFunction = fFunction & "Goto blah9" & vbNewLine & "blah9:" & vbNewLine
fFunction = fFunction & "Goto blah10" & vbNewLine & "blah10:" & vbNewLine
fFunction = fFunction & "End Sub" & vbNewLine

fFunction = Replace(fFunction, "blah1", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah2", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah3", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah4", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah5", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah6", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah7", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah8", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah9", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
fFunction = Replace(fFunction, "blah10", randomletter & RandomNumber & strings & RandomNumber & RandomNumber & RandomNumber & randomletter & RandomNumber & strings & RandomNumber & RandomNumber)
Case 3

End Select
ModuleFunction = fFunction

End Function

'--CRITICAL FUNCTIONS DO NOT REMOVE OR ALTER!--
Function Random(Lowerbound As Long, Upperbound As Long)
    Randomize
    Random = Int((Upperbound - Lowerbound) * Rnd + Lowerbound)
End Function

Public Function RandomNumber() As Integer
Randomize
var1 = Int(9 * Rnd)
RandomNumber = var1
End Function

Public Function strings()
For i = 1 To 23
If i = 2 Or i = 4 Or i = 6 Then
strings = strings & RandomNumber
Else
strings = strings & randomletter
End If
Next i
End Function
Public Function randomletter() As String
Anfang:
keyset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuyvwz"
Randomize
var1 = Int(Len(keyset) * Rnd)
If var1 = 0 Then GoTo Anfang
randomletter = Mid(keyset, var1, 1)
End Function
'--CRITICAL FUNCTIONS DO NOT REMOVE OR ALTER!--